<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>领料出货</title>
 	<link href="../resources/css/ligerui-all.css" rel="stylesheet" type="text/css" /> 
 	<link href="../resources/css/ligerui-icons.css" rel="stylesheet" type="text/css" /> 
	<script src="../resources/js/jquery-1.9.1.min.js" type="text/javascript"></script>
	<script src="../resources/js/ligerui.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../resources/js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="../resources/js/jquery.metadata.js"></script>
	<script type="text/javascript" src="../resources/js/messages_cn.js"></script>
	<script type="text/javascript" src="../resources/js/form-validate.js"></script>
    <script type="text/javascript">
    	$(function ()
        {
                  /*领料数据*/
	              window['g'] = $("#isr").ligerGrid({
	                	checkbox: true,
	                    columns: [
		                    { display: '领料单号', name: 'inStoreNO', width: 120, isSort: false, frozen: true},
		                    { display: '物料编码', name: 'rawMaterialNo', width: 120, isSort: false},
		                    { display: '物料名称', name: 'rawMaterialName', width: 100, isSort: false},
		    				 { display: '单位', name: 'unit', width: 100, isSort: false},
		                    { display: '单位成本', name: 'unitPrice', width: 100, isSort: false },
		                    { display: '数量', name: 'warehousingAmount', width: 100, isSort: false },
		    				{ display: '金额', name: 'priceAmount', width: 100, isSort: false },
		    			    { display: '入库时间', name: 'warehousingDate', type:'date', width: 100, isSort: false },
		    				{ display: '备注', name: 'memo', width: 300, isSort: false }
	                    ], //width: 1000,
	                    url : "list?status=1",
	                    width: '99.9%',
	                    pageSizeOptions: [3, 5, 7, 10],
	                    rownumbers:true
	                 });

	             /*数据验证*/  
	              $.metadata.setType("attr", "validate");
		          
		          $("#form1").validate({
		         	 errorPlacement: errorPlacement,
		         	 success: mess
		          });

		         	$("#form2").validate({
		         		 errorPlacement: errorPlacement,
			         	 success: mess
			         });

		           /*为form增加样式*/
	              $("form").ligerForm();

		           /*工具条*/
	                $("#toolBar").ligerToolBar( {
	                    items : [
									{ text: '领料出库', click: add,icon:'add' },
									{line: true},
									{ text: '导入', click: upload, icon: 'back' },
									{line: true},
									{ text: '导出', click: download, icon: 'up' },
									{line: true},
									{ text: '模板下载', click: template, icon: 'attibutes' },
								]
						
	                });
				/*查询按钮*/
				$("#Button1").click(function() {
					var param = $("#form0").serialize(); 
					var url = "list?" + param;
					$.post(url, 
							{'page':1, 'pagesize': 10}
					  , function(data){
							g.loadData(data);
							g.setOptions({'url': url, 'pageSizeOptions': [3, 5, 7, 10], 'page':1, 'pagesize': 10} );
						 });
					});
	             });

        /*增加领料, 跳转页面*/
        var add = function() {
        	 window.location.href="lessinstoreIndex";
            };

        var upload = function() {
                alert("ddd");
        }
            
        var download = function() {
      	   var s = g.getSelectedRows();
      	   var arrs = new Array();
      	   $(s).each(function(i){
          	   arrs.push(s[i].inStoreId);
             });
             var param = arrs.join(",");
             $("#param").val(param);
             $("#form1").submit();
         }

         var template = function() {
            window.location.href = "export?status=1";
         }

    </script>
    <style type="text/css">
		#isr #toolBar { margin-left:5px;}
        .l-table-edit-td{ padding:3px;}
        .l-button-submit,.l-button-reset{width:80px; float:left; margin-left:10px; padding-bottom:2px;}
        .l-verify-tip{ left:230px; top:120px;}
</style>
</head>

<body>
 <!-- 1.导航条 -->
   <span style=" margin: 5px 10px; display: block; font-weight: bold;">宝华茶餐厅 > 库存管理 > 领料出货</span>
 <!-- 2.查询条件 --> 
   <div id="isearch" style="width:100%; margin-bottom: 5px;">
	  <form name="form0" method="post"  id="form0">
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td align="right" class="l-table-edit-td" width="11%">领料单号:</td>
                <td align="left" class="l-table-edit-td" style="width:23px">
                   <input name="inStoreNO" type="text" ltype="text" id="inStoreNO"/>
                </td>
                
                 <td align="right" class="l-table-edit-td" width="10%">物料编码:</td>
                 <td align="left" class="l-table-edit-td" style="width:23%">
                    <input name="rawMaterialNo" type="text" ltype="text" id="rawMaterialNo"/>
                 </td>
                 
                 <td align="right" class="l-table-edit-td" width="11%">物料名称:</td>
                <td align="left" class="l-table-edit-td" style="width:23px">
                   <input name="rawMaterialName" type="text" ltype="text" id="rawMaterialName"/>
                   <input name="status" type="hidden" id="status" value="1"/>
                </td>
            </tr>
           
             <tr>
                <td align="right" class="l-table-edit-td" width="10%">领料日期:</td>
                <td align="left" class="l-table-edit-td" style="width:23px">
                   <input name="pre_warehousingDate" type="text" ltype="date" id="pre_warehousingDate"/> 至 
                   <input name="af_warehousingDate" type="text" ltype="date" id="af_warehousingDate"/>
                </td>
                
                <td align="right" class="l-table-edit-td" width="10%">入库数量:</td>
                <td align="left" class="l-table-edit-td" style="width:23px">
                    <input name="pre_warehousingAmount" type="text" ltype="spinner" id="pre_warehousingAmount"/> 至  
                    <input name="af_warehousingAmount" type="text" ltype="spinner" id="af_warehousingAmount"/>
                </td>
                
                 <td align="right" class="l-table-edit-td" width="10%">经办人:</td>
                 <td align="left" class="l-table-edit-td" style="width:23%">
                 	<input name="staffNO" type="text" ltype="text" id="staffNO"/>
                 </td>
            </tr>
             <tr>
                 <td colspan="5">&nbsp;</td>
                 <td>
	                 <input type="button" value="查询" id="Button1" class="l-button l-button-submit" /> 
		             <input type="reset" value="重置" class="l-button l-button-reset"/>
		         </td>
            </tr>
        </table>
    </form>
    </div>
    <div id="toolBar"></div>
	<div id="isr"></div>
	
	<form action="export" method="post" id="form1">
	    <input type="hidden" name="param" id="param">
	    <input type="hidden" name="status" id="status" value="1">
	</form>
</body>

</html>